#-------------------------------------------------
#
# Fridge build project for Linux, OSX and Win32
#
#-------------------------------------------------


DEFINES += FRIDGE_QTGUI_ENABLED


# suppress a few warnings
CCFLAG += -Wno-write-string \
        -fpermissive \
        -Wno-unused-parameter


QT       += core gui multimedia
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Fridge
#TEMPLATE = app

INCLUDEPATH += ../../../Source/Independent

# note: linux = unix:!macx:!symbian
unix:!macx:!symbian: INCLUDEPATH += ../../../Source/Linux
macx: INCLUDEPATH += ../../../Source/OSX
win32: INCLUDEPATH += ../../../Source/Win32

SOURCES +=\
    ../../../Source/Independent/FridgeGUI/*.cpp \
	../../../Source/Independent/*.cpp \
    ../../../Source/Independent/Controller/*.cpp \
    ../../../Source/Independent/FridgeScript/*.cpp \
    ../../../Source/Independent/Visuals/*.cpp \
    ../../../Source/Independent/Preset/*.cpp \
    ../../../Source/Independent/Widgets/*.cpp \

unix:!macx:!symbian {
    message(Building For Linux)
    SOURCES +=\
        ../../../Source/Linux/*.cpp
}

macx {
    message(Building For OSX)
    SOURCES +=\
        ../../../Source/OSX/*.cpp
}

win32 {
    message(Building For Windows)
    SOURCES +=\
        ../../../Source/Win32/*.cpp
}

HEADERS  +=\
    ../../../Source/Independent/FridgeGUI/*.h \
    ../../../Source/Independent/*.h \
    ../../../Source/Independent/Controller/*.h \
    ../../../Source/Independent/FridgeScript/*.h \
    ../../../Source/Independent/Visuals/*.h \
    ../../../Source/Independent/Preset/*.h \
    ../../../Source/Independent/Widgets/*.h \

unix:!macx:!symbian {
    HEADERS +=\
        ../../../Source/Linux/Platform_Main.h
}

macx {
    HEADERS +=\
        ../../../Source/OSX/Platform_Main.h
}

win32 {
    HEADERS +=\
        ../../../Source/Win32/Platform_Main.h
}

FORMS    += \
    ../../../Source/Independent/FridgeGUI/Fridge.ui



### platform-specific compiler options

unix:!macx:!symbian {
	FRIDGE_FLAGS += -Wno-write-string \
					-fpermissive \
					-Wno-unused-parameter
	
	QMAKE_CXXFLAGS_DEBUG += $$FRIDGE_FLAGS
	QMAKE_CXXFLAGS_RELEASE += $$FRIDGE_FLAGS
	QMAKE_LIBDIR += $$PWD/../../../../../SDL-1.3.0-6248/build/.libs/
	LIBS += -lSDL \
			-lSDL_ttf \
			-lpng \
			-llua \
			-lGL \
			-lasound \
			-larchive
	
	CONFIG += link_pkgconfig
	PKGCONFIG += gtk+-2.0
	INCLUDEPATH += $$PWD/../../../../../SDL-1.3.0-6248/include
	DEPENDPATH += $$PWD/../../../../../SDL-1.3.0-6248/include
}

macx {
        LIBS += -framework libpng
        LIBS += -framework Lua
        LIBS += -framework Carbon
        LIBS += -framework AudioUnit
        LIBS += -framework OpenGL
        LIBS += -L/usr/local/lib/ -lSDL-1.3.0
        LIBS += -L/usr/local/lib/ -lSDL_ttf
        LIBS += -L$$PWD/../../../../../../../opt/local/lib/ -larchive

        INCLUDEPATH += $$PWD/../../../../../../../usr/local/include/SDL
        INCLUDEPATH += $$PWD/../../../../../../../opt/local/include/
        INCLUDEPATH += $$PWD/../../../../../../../opt/local/lib/libzip/include
}

win32 {
	FRIDGE_WIN_INCDIR = $$PWD/../../../../..
	FRIDGE_WIN_LIBDIR = 
	
    LIBS += -L$$PWD/../../../lib/ \
            -lSDL \
            -lSDLmain \
            -lzlib \
            -llibpng15 \
            -llua5.1 \
            -lSDL_ttf \
			-larchive
	
    INCLUDEPATH_TMP = $$FRIDGE_WIN_INCDIR/SDL-1.3.0-6248/SDL/include \
                    $$FRIDGE_WIN_INCDIR/zlib-1.2.5 \
                    $$FRIDGE_WIN_INCDIR/lpng1510 \
                    $$FRIDGE_WIN_INCDIR/lua-5.2.0/src \
                    $$FRIDGE_WIN_INCDIR/SDL_ttf-2.0.11 \
                    $$FRIDGE_WIN_INCDIR/libarchive-2.8.4/libarchive
	
	INCLUDEPATH += $$INCLUDEPATH_TMP
	DEPENDPATH += $$INCLUDEPATH_TMP
}
